﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace CarD
{
    public class PlayerController : MonoBehaviour
    {
        private float moveSpeed = 20;
        private float turnSpeed = 45;
        private float forwardInput,horizontalInput;

        // Start is called before the first frame update
        void Start()
        {
        }

        // Update is called once per frame
        void Update()
        {
            horizontalInput = Input.GetAxis("Horizontal");
            forwardInput = Input.GetAxis("Vertical");
            //Move forward
            transform.Translate(moveSpeed * Time.deltaTime * forwardInput * Vector3.forward);
            //Turn Around
            transform.Rotate(Vector3.up,turnSpeed * Time.deltaTime * horizontalInput );
        }
    }
}